<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>while循环</title>
</head>
<body>
<script>
    cars=["BMW","Volvo","Saab","Ford"];
    var i=0;
    for(;cars[i];){
        document.write(cars[i]+"<br>");
        i++;
    }

</script>
</body>
</html>